Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: #6796 check for visibleOptions existing before looking up the index #6797

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

elliotspall
Copy link
Contributor

Prevent "Uncaught TypeError: Cannot read properties of undefined (reading 'findIndex')" error from being thrown when visibleOptions is null or undefined.

Fix #6796

Description

Because options is an optional prop, visibleOptions can potentially be undefined. If visibleOptions is not verified as existing first, calling findIndex results in an "Uncaught TypeError: Cannot read properties of undefined (reading 'findIndex')".

Changes

  • Check that visibleOptions exists before trying to search the options.

Prevent "Uncaught TypeError: Cannot read properties of undefined (reading 'findIndex')" error from being thrown when visibleOptions is null or undefined.
Copy link

vercel bot commented Jun 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2024 2:39pm
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Jun 26, 2024 2:39pm

@melloware melloware added the Type: Bug Issue contains a defect related to a specific component. label Jun 26, 2024
@melloware melloware merged commit fb7c44b into primefaces:master Jun 26, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dropdown: Null / Undefined options causes editable to throw an error.
2 participants